#include "StdAfx.h"
#include "CLIbridge.h"

using namespace System;
namespace $RootNamespace$
{

	void $Abstraction$::Operation()
	{
		$Implementor$->OperationImp();
	}

	void $Abstraction$::Test()
	{
		$Abstraction$ ^abstraction = gcnew $RefinedAbstraction$();
	
		// Set implementation and call
		abstraction->$Implementor$ = gcnew CLIConcreteImplementorA();
		abstraction->Operation();
	
		// Change implemention and call
		abstraction->$Implementor$ = gcnew CLIConcreteImplementorB();
		abstraction->Operation();
	}

	void $RefinedAbstraction$::Operation()
	{
		$Implementor$->OperationImp();
	}

	void CLIConcreteImplementorA::OperationImp()
	{
		Console::WriteLine("OperationA");
	}

	void CLIConcreteImplementorB::OperationImp()
	{
		Console::WriteLine("OperationB");
	}
}